<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta name = "format-detection" content = "telephone=no">
    <title>收货地址</title>
    <link rel="stylesheet" href="/Public/Home/css/address.css">
    <script type="text/javascript">
		//是否直接头部使用自动配置
    	var yc_wx_useInHeader = false;
		//是否使用自动定位
		var yc_wx_location = true;
    </script>      
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo ($ak); ?>"></script>    
</head>
<body>
<div class="warp">
    <form id="addressForm" action="<?php echo url('Address/doAddAddress');?>" method="post" accept-charset="UTF-8" class="form-horizontal">
        <input id="addrId"name="addrId" type="hidden" value="<?php echo ($data[addr_id]); ?>"/>
        <input name="url" type="hidden" value="<?php echo ($url); ?>"/>
        <div class="address-modify pdLR">
            <ul>
                <li><input type="text" id="rec-mname" name="name" value="<?php echo ($data[name]); ?>" placeholder="收货人姓名"></li>
                <li><input type="text" id="rec-mobile" name="mobile" value="<?php echo ($data[mobile]); ?>" placeholder="手机号"></li>
                <li>
                    <div class="content-block">
                        <input id="rec-address-choose" name="area" value="<?php echo ($data[area]); ?>" type="text" readonly placeholder="省/市/区" />
                        <input id="rec-address" type="hidden" />
                        <input id="lng" name="store_lnt" type="hidden" value="<?php echo ($data[store_lnt]); ?>"/>
                        <input id="lat" name="store_lat" type="hidden" value="<?php echo ($data[store_lat]); ?>"/>

                    </div>
                    <a href="javascript:void(0);" class="location-address">定位当前地址</a>
                </li>
                <li><textarea id="rec-street" name="addr" id="street"><?php echo ($data[addr]); ?></textarea></li>
                <li><div class="default-set <?php if($data[def_addr] == 1 ): ?>active<?php endif; ?> ">设置为默认地址</div> <input id="rec-type" name="def_addr" type="hidden" value="<?php echo ($data[def_addr]); ?>" /></li>
                <li><button id="save-address" type="button" class="btn btn-second btn-block">保存</button></li>
                <li></li>
            </ul>
        </div>
    </form>
</div>
<div class="location-box">
    <div class="search-bar">
            <a href="javascript:void(0);" class="back">取消</a>
            <p class="input-box">
                <input id='aname' placeholder="请输入您的具体地址" type='text' style="border:1px solid #e5e5e5 "/>
                <a href="javascript:void(0);" class="value-delete"></a>
            </p>
    </div>
    <div class="location-map" id="container_map">
        <div id="bdMap"></div>
        <div id ="marker"></div>
    </div>
    <div  class="location-result pdLR">
        <ul id="location-result">
        </ul>
    </div>
</div>
<div class="alert-popup validate-tips">
    <p></p>
    <div class="single-show"><a href="javascript:void(0);" class="confirm">知道了</a></div>
</div>
<script src="/Public/Home/js/validate.js"></script>
<script src="/Public/Home/js/member/location.js?v=201703024007"></script>
<script type="text/javascript">
if(_global.isWeiXinLoad){
	yc_wx_options["refuseCallback"] = refuseCallback;
	yc_wx_options["mapCallback"] = mapCallback;
}
var isLocationChosen = $("#addrId").val() == "" ? false : true;
var isInBMFunc = false;
</script>
<script src="/Public/Home/js/member/infoAddressEdit.js?v=201703010002"></script>
<script type="text/javascript">
if(!isLocationChosen){
	_global.promote.loadPopup("正在定位中...");
	wxAutoConfig(yc_wx_options);
}else{
	BMapGetLocation();
}
</script>
</body>
</html>